﻿using System;
using System.Collections.Generic;
using System.Linq;
using DomainModels.DomainModels.Systems;

namespace Core.Helpers
{
    public static class UrlBuilder
    {
        private const string Url = @"https://api.vk.com/method/{0}?{1}&{2}";

        public static Uri Builder(TokenResponse token, string types, Dictionary<string, string> parameters)
        {
            var sb = parameters.Keys.Select(key => string.Format("{0}={1}", key, parameters[key]));
            return new Uri(string.Format(Url, types, string.Join("&", sb), token.TokenAsParameter));
        }
    }
}
